package com.google.code.memoriesalbum.model;

import org.slim3.datastore.Attribute;
import org.slim3.datastore.Model;

import com.google.appengine.api.datastore.Key;

/**
 * OAuthによる認証の情報を保持するModel.
 * <p>Keyのname値としてGmailアドレスを使用する。</p>
 * @author shin1ogawa
 */
@Model
public class Account {

	@Attribute(primaryKey = true)
	private Key key;

	private String email;

	private String token;

	private String tokenSecret;

	private Long schemaVersion = 1L;

	private Boolean enable = Boolean.FALSE;


	/**
	 * @return the key
	 * @category accessor
	 */
	public Key getKey() {
		return key;
	}

	/**
	 * @param key the key to set
	 * @category accessor
	 */
	public void setKey(Key key) {
		this.key = key;
	}

	/**
	 * @return the oauthToken
	 * @category accessor
	 */
	public String getToken() {
		return token;
	}

	/**
	 * @param oauthToken the oauthToken to set
	 * @category accessor
	 */
	public void setToken(String oauthToken) {
		this.token = oauthToken;
	}

	/**
	 * @return the oauthTokenSecret
	 * @category accessor
	 */
	public String getTokenSecret() {
		return tokenSecret;
	}

	/**
	 * @param oauthTokenSecret the oauthTokenSecret to set
	 * @category accessor
	 */
	public void setTokenSecret(String oauthTokenSecret) {
		this.tokenSecret = oauthTokenSecret;
	}

	/**
	 * @param schemaVersion the schemaVersion to set
	 * @category accessor
	 */
	public void setSchemaVersion(Long schemaVersion) {
		this.schemaVersion = schemaVersion;
	}

	/**
	 * @return the schemaVersion
	 * @category accessor
	 */
	public Long getSchemaVersion() {
		return schemaVersion;
	}

	/**
	 * @param enable the enable to set
	 * @category accessor
	 */
	public void setEnable(Boolean enable) {
		this.enable = enable;
	}

	/**
	 * @return the enable
	 * @category accessor
	 */
	public Boolean getEnable() {
		return enable;
	}

	/**
	 * @param email the email to set
	 * @category accessor
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @return the email
	 * @category accessor
	 */
	public String getEmail() {
		return email;
	}
}
